/*
 * hkh-project
 * leafteamwork.blogspot.com
 * Tool: Netbeans 6.7.1 - SQL Server 2005
 */
package vn.com.hkh.util;
import java.io.IOException;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
 *
 * @author leaf
 */
public class DatabaseConfig {

    private static final String DB_CONFIG_FILE = "./db.properties";
    private static Properties props = null;
    private static Logger logger = Logger.getLogger(DatabaseConfig.class.getName());

    public static String readKey(String key) {
        try {
            String value = "";
            Properties properties = new Properties();
            properties.load(DatabaseConfig.class.getResourceAsStream(DB_CONFIG_FILE));
            DatabaseConfig.props = properties;
            value = props.getProperty(key);
            return value;
        } catch (IOException ex) {
            logger.log(Level.SEVERE, null, ex);
            return null;
        }
    }
}
